package com.feilong.edgeAI.remind.room.db;

import android.content.Context;

import androidx.room.Database;
import androidx.room.Room;
import androidx.room.RoomDatabase;
import androidx.room.TypeConverters;

import com.feilong.edgeAI.remind.room.bean.RemindBean;
import com.feilong.edgeAI.remind.room.dao.RemindDao;


@Database(entities = {RemindBean.class}, version = 1, exportSchema = false)
@TypeConverters({ConversionFactory.class})
public abstract class RemindDatabase extends RoomDatabase {

    public static RemindDatabase getDefault(Context context) {
        return buildDatabase(context);
    }

    private static RemindDatabase buildDatabase(Context context) {
        return Room.databaseBuilder(context.getApplicationContext(), RemindDatabase.class, "REMIND.db")
                .allowMainThreadQueries()
                .build();
    }

    public abstract RemindDao getRemindDao();
}